import javax.microedition.lcdui.*;

class HelloScreen
    extends Form
    implements CommandListener
{

    private final HelloWorldMIDlet midlet;
    private final Command exitCommand; // Exit command for closing the MIDlet in the device UI.

    public HelloScreen(HelloWorldMIDlet midlet, String string)
    {
        super("");
        StringItem helloText = new StringItem("", string);
        super.append(helloText);
        this.midlet = midlet;
        exitCommand = new Command("Quit", Command.EXIT, 1);
        addCommand(exitCommand);
        setCommandListener(this);
    }

    public void commandAction(Command command, Displayable displayable)
    {
        if (command == exitCommand)
        {
            midlet.notifyDestroyed();
        }
    }

}